﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;

namespace eCashDatalayer
{
    public class UserModel : INotifyPropertyChanged
    {

        public event PropertyChangedEventHandler PropertyChanged;

        private int _iUserid;
        private string _sFirstName;
        private string _sLastname;
        private string _sUsername;
        private string _sPassword;
        private string _sEmail;
        private List<string>  _sPermissions;
        private bool _bIsValid;
        private bool _bIsconfirmed;
        private bool _bIsactive;
        private bool _bPermitted;

        /// When the Property is changed from the PL this gets Fired
        /// </summary>
        /// <param name="property"></param>
        private void OnPropertyChanged(String property)
        {

            // DAL objConverter = new DAL();

            // List<RegistrationModel> Model = new List<RegistrationModel>();

            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(property));
                //objConverter.Updatedata();                
            }
        }


        public int iUserid
        {

            get
            {
                return _iUserid;
            }
            set
            {
                _iUserid = value;

                OnPropertyChanged("iUserid");

            }
        }


        public string sUsername
        {

            get
            {
                return _sUsername;
            }
            set
            {
                _sUsername = value;

                OnPropertyChanged("sUsername");

            }
        }

        public string sPassword
        {

            get
            {
                return _sPassword;
            }
            set
            {
                _sPassword = value;

                OnPropertyChanged("sPassword");

            }
        }
        

        public string sFirstName
        {

            get
            {
                return _sFirstName;
            }
            set
            {
                _sFirstName = value;

                OnPropertyChanged("sFirstName");

            }
        }

        public string sLastname
        {

            get
            {
                return _sLastname;
            }
            set
            {
                _sLastname = value;

                OnPropertyChanged("sLastname");

            }
        }


        public string sEmailAddress
        {

            get
            {
                return _sEmail;
            }
            set
            {
                _sEmail = value;

                OnPropertyChanged("sEmailAddress");

            }
        }

        public List<string> sPermissions
        {

            get
            {
                return _sPermissions;
            }
            set
            {
                _sPermissions = value;

                OnPropertyChanged("sPermissions");

            }
        }

        public Boolean bIsValid
        {

            get
            {
                return _bIsValid;
            }
            set
            {
                _bIsValid = value;

                OnPropertyChanged("bIsValid");

            }
        }

        public Boolean bIsconfirmed
        {

            get
            {
                return _bIsconfirmed;
            }
            set
            {
                _bIsconfirmed = value;

                OnPropertyChanged("bIsconfirmed");

            }
        }

        public Boolean bIsactive
        {
            get
            {
                return _bIsactive;
            }
            set
            {
                _bIsactive = value;

                 OnPropertyChanged("bIsactive");
             }
        }

        public Boolean bPermitted
        {
            get
            {
                return _bPermitted;
            }
            set
            {
                _bPermitted = value;

                OnPropertyChanged("bPermitted");
            }
        }


        
    }
}